package bist.believeinstep.util;


public class Constant {
	
	/**
	 * RESOURCE
	 */
	public static String applicationConfig = "application_config.xml";
	public static final String DEFAULT_DIAGRAM_IMAGE_EXTENSION = "png";
	
	/**
	 * LOCALE_LANGUAGE_VI, LOCALE_LANGUAGE_EN, DATE_DELIMITER
	 */
	public static String LOCALE_LANGUAGE_VI = "vi";
	public static String LOCALE_LANGUAGE_EN = "en";
	public static String DATE_DELIMITER = "/";
	public static String DATE_FORMAT = "dd/mm/yyyy";
	public static String DATETIME_FORMAT = "dd/mm/yyyy H:mm:ss";
	public static int COMPANY_ID = 1;
	
	/**
	 * 
	 * @author bluheve
	 *
	 */
	public static enum RSType{
		RESTAURANT, HOTEL;
		public static RSType create(String rsType){
			if(rsType.equalsIgnoreCase(RESTAURANT.name())){
				return RESTAURANT;
			}
			else if(rsType.equalsIgnoreCase(HOTEL.name())){
				return HOTEL;
			}
			else
				return null;
		}
	}
	
	public static enum Rate{
		LOW, MEDIUM, HIGH;
		public static Rate create(String rate){
			if(rate.equalsIgnoreCase(LOW.name())){
				return LOW;
			}
			else if(rate.equalsIgnoreCase(MEDIUM.name())){
				return MEDIUM;
			}
			else if(rate.equalsIgnoreCase(HIGH.name())){
				return HIGH;
			}
			else
				return null;
		}
	}
	
	public static enum PriceState{
		ACTIVE, UNACTIVE;
		
		public static PriceState create(String priceState){
			if(priceState.equalsIgnoreCase(ACTIVE.name())){
				return ACTIVE;
			}
			else if(priceState.equalsIgnoreCase(UNACTIVE.name())){
				return UNACTIVE;
			}
			else
				return null;
		}
	}
	
	public static enum BookingState{
		NONE, CONFIRMED, DONE;
		public static BookingState create(String bookingState){
			if(bookingState.equalsIgnoreCase(NONE.name())){
				return NONE;
			}
			else if(bookingState.equalsIgnoreCase(CONFIRMED.name())){
				return CONFIRMED;
			}
			else if(bookingState.equalsIgnoreCase(DONE.name())){
				return DONE;
			}
			else
				return null;
		}
	}
	
	public static enum TourType{ 
		INTERNATIONAL, NATIONAL;
		public static TourType create(String tourState){
			if(tourState.equalsIgnoreCase(INTERNATIONAL.name())){
				return INTERNATIONAL;
			}
			else if(tourState.equalsIgnoreCase(NATIONAL.name())){
				return NATIONAL;
			}
			else
				return null;
		}
	}
	
	public static enum State{
		NONE, ACTIVE, REMOVE;
		
		public String toString(){
			switch (this) {
			case NONE:
				return "Mới tạo";
			case ACTIVE:
				return "Đang sử dụng";
			case REMOVE:
				return "Đã xóa";
			default:
				return "";
			}
		}
		
		public static State create(String state){
			if(state.equalsIgnoreCase(NONE.name())){
				return NONE;
			}else if(state.equalsIgnoreCase(ACTIVE.name())){
				return ACTIVE;
			}else if(state.equalsIgnoreCase(REMOVE.name())){
				return REMOVE;
			}else{
				return null;
			}
		}
	}
	
	public static enum TravelingType{
		NATURAL, HUMANITY, ENTERTAINMENT;
		public static TravelingType create(String type){
			if(type.equalsIgnoreCase(NATURAL.name())){
				return NATURAL;
			}
			else if(type.equalsIgnoreCase(HUMANITY.name())){
				return HUMANITY;
			}
			else if(type.equalsIgnoreCase(ENTERTAINMENT.name())){
				return ENTERTAINMENT;
			}
			else
				return null;
		}
	}
	
	public static enum ArticleType{
		BIST, LINE, PRESS, CONSULTANT, CHRONICAL;
		
		public String toString(){
			switch (this) {
			case BIST:
				return "Believe In Step";
			case LINE:
				return "Thông tin ngành";
			case PRESS:
				return "Thông cáo báo chí";
			case CONSULTANT:
				return "Tư vấn du lịch";
			case CHRONICAL:
				return "Ký sự";
			default:
				return "";
			}
		}
		
		public static ArticleType create(String type){
			if(type.equalsIgnoreCase(BIST.name())){
				return BIST;
			}else if(type.equalsIgnoreCase(LINE.name())){
				return LINE;
			}else if(type.equalsIgnoreCase(PRESS.name())){
				return PRESS;
			}else if(type.equalsIgnoreCase(CONSULTANT.name())){
				return CONSULTANT;
			}else if(type.equalsIgnoreCase(CHRONICAL.name())){
				return CHRONICAL;
			}else {
				return null;
			}
		}
	}
	
	public static enum Role{
		CUSTOMER, ADMINISTRATOR, WRITER;
	
	public static Role create(String type){
		if(type.equalsIgnoreCase(CUSTOMER.name())){
			return CUSTOMER;
		}
		else if(type.equalsIgnoreCase(ADMINISTRATOR.name())){
			return ADMINISTRATOR;
		}
		else if(type.equalsIgnoreCase(WRITER.name())){
			return WRITER;
		}
		else{
			return null;
		}
	}
}
	public static enum MediaType{
		BIST, LINK, CHRONICAL;
		
		public static MediaType create(String type){
			if(type.equalsIgnoreCase(BIST.name())){
				return BIST;
			}else if(type.equalsIgnoreCase(LINK.name())){
				return LINK;
			}else if(type.equalsIgnoreCase(CHRONICAL.name())){
				return CHRONICAL;
			}else {
				return null;
			}
		}
	}
	
	public static enum ImageType{
		TOUR, ARTICLE, RESTAURANT_HOTEL;
		public static ImageType create(String imageType){
			if(imageType.equalsIgnoreCase(TOUR.name())){
				return TOUR;
			}
			else if(imageType.equalsIgnoreCase(ARTICLE.name())){
				return ARTICLE;
			}
			else if(imageType.equalsIgnoreCase(RESTAURANT_HOTEL.name())){
				return RESTAURANT_HOTEL;
			}
			else
				return null;
		}
	}
	
	public static enum PaymentType{
		CASH, CARD, PORTAL;
		public static PaymentType create(String paymentType){
			if(paymentType.equalsIgnoreCase(CASH.name())){
				return CARD;
			}
			else if(paymentType.equalsIgnoreCase(CARD.name())){
				return CARD;
			}
			else if(paymentType.equalsIgnoreCase(PORTAL.name())){
				return PORTAL;
			}
			else
				return null;
		}
	}
}
